package com.snail.controller;

import com.snail.model.pojo.mall.BizProduct;
import com.snail.model.pojo.user.SysUser;
import com.snail.result.Result;
import com.snail.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class SysUserController {

    @Autowired
    private SysUserService sysUserServiceImpl;
    /**
     * 根据userId查询商家信息
     * @param userId 商家ID
     * @return 所有商品信息（null表示未找到）
     */
    @GetMapping("/{userId}")
    public Result<SysUser> getProductsBySellerId(@PathVariable("userId") Long userId) {
        return Result.success(sysUserServiceImpl.getUserWithDept(userId));
    }
}
